package com.team.service.service.impl;

import java.util.List;
import com.team.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.team.service.mapper.ServiceCategoryMapper;
import com.team.service.domain.ServiceCategory;
import com.team.service.service.IServiceCategoryService;

/**
 * 服务分类Service业务层处理
 * 
 * @author panyue
 * @date 2025-07-09
 */
@Service
public class ServiceCategoryServiceImpl implements IServiceCategoryService 
{
    @Autowired
    private ServiceCategoryMapper serviceCategoryMapper;

    /**
     * 查询服务分类
     * 
     * @param id 服务分类主键
     * @return 服务分类
     */
    @Override
    public ServiceCategory selectServiceCategoryById(Long id)
    {
        return serviceCategoryMapper.selectServiceCategoryById(id);
    }

    /**
     * 查询服务分类列表
     * 
     * @param serviceCategory 服务分类
     * @return 服务分类
     */
    @Override
    public List<ServiceCategory> selectServiceCategoryList(ServiceCategory serviceCategory)
    {
        return serviceCategoryMapper.selectServiceCategoryList(serviceCategory);
    }

    /**
     * 新增服务分类
     * 
     * @param serviceCategory 服务分类
     * @return 结果
     */
    @Override
    public int insertServiceCategory(ServiceCategory serviceCategory)
    {
        serviceCategory.setCreateTime(DateUtils.getNowDate());
        return serviceCategoryMapper.insertServiceCategory(serviceCategory);
    }

    /**
     * 修改服务分类
     * 
     * @param serviceCategory 服务分类
     * @return 结果
     */
    @Override
    public int updateServiceCategory(ServiceCategory serviceCategory)
    {
        serviceCategory.setUpdateTime(DateUtils.getNowDate());
        return serviceCategoryMapper.updateServiceCategory(serviceCategory);
    }

    /**
     * 批量删除服务分类
     * 
     * @param ids 需要删除的服务分类主键
     * @return 结果
     */
    @Override
    public int deleteServiceCategoryByIds(Long[] ids)
    {
        return serviceCategoryMapper.deleteServiceCategoryByIds(ids);
    }

    /**
     * 删除服务分类信息
     * 
     * @param id 服务分类主键
     * @return 结果
     */
    @Override
    public int deleteServiceCategoryById(Long id)
    {
        return serviceCategoryMapper.deleteServiceCategoryById(id);
    }
}
